package com.sgb.kjwl.view.ui.adapter.packers;

import android.content.Context;
import android.widget.TextView;

import com.sgb.kjwl.BR;
import com.sgb.kjwl.R;
import com.sgb.kjwl.model.entity.QuotedPriceSearchEntity;
import com.swgk.core.recyclerview.adapter.BaseRecycleAdapter;
import com.swgk.core.recyclerview.adapter.ItemViewHolder;
import com.swgk.core.util.DateUtils;

import java.util.List;

public class QuotePriceSearchAdapter extends BaseRecycleAdapter<QuotedPriceSearchEntity> {

    public QuotePriceSearchAdapter(Context context, int layoutId, List<QuotedPriceSearchEntity> datas) {
        super(context, R.layout.item_quote_list_search, datas);
    }

    @Override
    public void convert(ItemViewHolder holder, QuotedPriceSearchEntity quotedPriceSearchEntity) {
        holder.setBinding(BR.viewModel, quotedPriceSearchEntity);
        TextView tvTime = holder.itemView.findViewById(R.id.tv_time);
        tvTime.setText(String.format("%s 发布", DateUtils.timestampToDate(quotedPriceSearchEntity.getCreateTime())));
    }
}
